package Bebetter.Day01;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author:galaxy_yan
 * @Date: 2022/11/20
 * @Time: 20:20
 * @Description
 */
public class B1 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
//        队伍个数
        int num;
       num=sc.nextInt();
//        队员水平值
        int[] array=new int[3*num];
        for (int i = 0; i < array.length; i++) {
            array[i]=sc.nextInt();
        }
        Arrays.sort(array);
        int count=0;
        for (int i = 0; i < num; i++) {
            count += array[array.length-2*(i+1)];
        }
        System.out.println(count);
    }
}
